package com.aigis.big4.tmp.javase.thread.queue;

public class Consumer implements Runnable {
    private PublicBox box;

    public Consumer(PublicBox box){
      this.box=box;
    }

    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            try{
                Thread.sleep(3000);
            }catch (InterruptedException e){
               e.printStackTrace();
            }
            //消费一个
            box.decrease();
        }

    }
}
